package com.bestdata.forward.cachecenter;


import com.bestdata.forward.model.BridgeSecretDTO;
import com.bestdata.forward.model.DeviceDTO;
import com.bestdata.forward.model.SensorConfigDTO;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * 缓存中心工厂
 *
 * @author chizy
 * @date 2021年1月15日14:41:33
 * @version 1.0.0
 */
public class CacheCenterFactory {

    /**
     * 存储桥梁秘钥密匙缓存中心
     * key:bridgeCodeName
     * value:BridgeSecretDTO{apiKey,apiSecret}
     */
    public static Map<String, BridgeSecretDTO> bridgeSecretMap = new HashMap<>();

    /**
     * 全局token缓存中心
     * key:bridgeCodeName
     * value:token
     */
    public static Map<String, String> globalTokenMap = new HashMap();

    /**
     * 结构物ID缓存中心
     * key:bridgeCodeName
     * value:ID
     */
    public static Map<String, String> bridgeIDMap = new HashMap();

    /**
     * 桥梁与旗下所有传感器关系缓存中心
     * key:bridgeCodeName
     * value:Map<String, SensorConfigDTO>联智北斗平台传感器配置
     */
    public static Map<String, Map<String, SensorConfigDTO>> bridgeSensorConfigConnectionMap = new HashMap();

    /**
     * PMS设备配置缓存中心
     * key:devid
     * value:DeviceDTO
     */
    public static Map<String, DeviceDTO> deviceConfigMap = new HashMap();

    /**
     * 接收数据缓存阻塞队列
     */
    public static BlockingQueue<DeviceDTO> queue = new ArrayBlockingQueue<>(1000);
}
